#include <iostream>
#include <cmath>
using namespace std;

void compoundCalculator()
{
    int  method;
    int T;
    double A;
    double P;
    double R;
    string d;

    cout<<"welcome to compounding interest calculator\n"
        <<"please enter your compounding method\n\n"
        <<"1 for annually, 2 for quarterly, 3 for monthly, 4 for weekly\n"
        <<"5 for daily, 6 for continuously\n\n";
    cin>> method;
    cout<<endl;
    if (method==1)
    {
        cout<<"what is the present value?\n";
        cin>>P;
        cout<<"what is the interest rate?\n";
        cin>>R;
        cout<<"what is the year period?\n";
        cin>>T;
        A = P * pow ( 1 + R / 1, T) ;
        cout<<"your future value will be "<< A <<endl;
    }
    if (method==2)
    {
        cout<<"what is the present value?\n";
        cin>>P;
        cout<<"what is the interest rate?\n";
        cin>>R;
        cout<<"what is the year period?\n";
        cin>>T;
        A = P * pow ( 1 + R / 4, 4*T);
        cout<<"your future value will be "<< A <<endl;
    }
    if (method==3)
    {
        cout<<"what is the present value?\n";
        cin>>P;
        cout<<"what is the interest rate?\n";
        cin>>R;
        cout<<"what is the year period?\n";
        cin>>T;
        A = P * pow ( 1 + R / 12, 12*T);
        cout<<"your future value will be "<< A <<endl;
    }
    if (method==4)
    {
        cout<<"what is the present value?\n";
        cin>>P;
        cout<<"what is the interest rate?\n";
        cin>>R;
        cout<<"what is the year period?\n";
        cin>>T;
        A = P * pow ( 1 + R / 52, 52*T);
        cout<<"your future value will be "<< A <<endl;
    }
    if (method==5)
    {
        cout<<"what is the present value?\n";
        cin>>P;
        cout<<"what is the interest rate?\n";
        cin>>R;
        cout<<"what is the year period?\n";
        cin>>T;
        A = P * pow ( 1 + R / 365, 365*T);
        cout<<"your future value will be "<< A <<endl;
    }
    if (method==6)
    {
        cout<<"what is the present value?\n";
        cin>>P;
        cout<<"what is the interest rate?\n";
        cin>>R;
        cout<<"what is the year period?\n";
        cin>>T;
        A = P * pow (2.71828, R*T);
        cout<<"your future value will be "<< A <<endl;
    }
    system ("pause");
    return;
}